package cz.muni.fi.pb138.eis_core;

/**
 * Representation of an artwork.
 * 
 * @author Jakub Senko
 */
public class ArtworkEntity
{
    private long id;
    private long expositionId;
    private String name;
    private String author;
    private String description;
    
    /**
     * Sets id of the artwork.
     * 
     * @param id id of the artwork
     */
    public void setId(long id)
    {
        this.id = id;
    }
    
    /**
     * Gets id of the artwork.
     * 
     * @return id of the artwork
     */
    public long getId()
    {
        return id;
    }
    
    /**
     * Sets id of the exposition.
     * 
     * @param expositionId id of the exposition
     */
    public void setExpositionId(long expositionId)
    {
        this.expositionId = expositionId;
    }
    
    /**
     * Gets id of the exposition.
     * 
     * @return id of the exposition
     */
    public long getExpositionId()
    {
        return expositionId;
    }
    
    /**
     * Sets name of the artwork.
     * 
     * @param name name of the artwork
     */
    public void setName(String name)
    {
        this.name = name;
    }
    
    /**
     * Gets name of the artwork.
     * 
     * @return name of the artwork
     */
    public String getName()
    {
        return name;
    }
    
    /**
     * Sets author of the artwork.
     * 
     * @param author author of the artwork
     */
    public void setAuthor(String author)
    {
        this.author = author;
    }
    
    /**
     * Gets author of the artwork.
     * 
     * @return author of the artwork
     */
    public String getAuthor()
    {
        return author;
    }
    
    /**
     * Sets description of the artwork.
     * 
     * @param description description of the artwork
     */
    public void setDescription(String description)
    {
        this.description = description;
    }
    
    /**
     * Gets description of the artwork.
     * 
     * @return description of the artwork
     */
    public String getDescription()
    {
        return description;
    }
    
    @Override
    public String toString()
    {
        return "[id=" + id + ", expositionId=" + expositionId
                + ", name=" + name + ", author=" + author
                + ", description=" + description + "]";
    }
    
    @Override
    public boolean equals(Object o) {
       if (this == o) return true;
       if (o == null || getClass() != o.getClass()) return false;

       ArtworkEntity entity = (ArtworkEntity) o;

       if (id != entity.id) return false;

       return true;
    }

    @Override
    public int hashCode()
    {
        return (int) id;
    }
}

